﻿using System;
using System.Collections.Generic;
using System.Text;
using Lswweb.Model;
using Lswweb.Common;

namespace Lswweb.IDAL
{
    public interface IProducts
    {
        /// <summary>
        /// 获取文章实体类
        /// </summary>
        /// <param name="productId">文章Id</param>
        /// <returns>返回文章实体类</returns>
        ProductInfo GetProduct(int productId);

        ProductInfo GetNextProduct(int productId, int categoryId);

        ProductInfo GetPrevProduct(int productId, int categoryId);

        IList<ProductInfo> GetProducts(string searchKey, SearchKeyType searchKeyType, int categoryId, Boolean? isWholesale, StatusType? type, AuditingStatusType? auditingStatus, bool? isHot, bool? isTop, Pair<DateTime?> dateTimeRange, Pair<Decimal?> priceRange, string orderBy, string ver, int pageIndex, int pageSize, out int totalRecord);

        /// <summary>
        /// 添加文章信息
        /// </summary>
        /// <param name="productInfo">信息实体类</param>
        /// <returns>返回新信息的Id</returns>
        int Insert(ProductInfo productInfo);

        /// <summary>
        /// 更新文章信息
        /// </summary>
        /// <param name="productInfo">信息实体类</param>
        bool Update(ProductInfo productInfo);
        bool UpdateIsTop(int productId, bool isTop);
        bool UpdateIsHot(int productId, bool isHot);
        bool UpdateStatus(int productId, StatusType type);
        bool UpdateStatus(int productId, AuditingStatusType type,string remark);
        bool UpdateCategory(int productId, int categoryId);
        bool UpdateImageUrl(int productId, string imageUrl);

        bool UpdateDisplayOrder(int productId, int displayOrder);

        object GetFieldValue(int productId, string fieldName);


        /// <summary>
        /// 删除文章
        /// </summary>
        /// <param name="productId">文章Id</param>
        bool Delete(int productId);

        #region UpFileImage

        bool AddImage(int productId,int upFileId);

        #endregion
    }
}
